//
//  AnimationViewModel.m
//  Home
//
//  Created by 曹连华 on 2019/6/21.
//  Copyright © 2019 曹连华. All rights reserved.
//

#import "BaseAnimationViewModel.h"
#import "BaseAnimationTitleTVCellModel.h"

@implementation BaseAnimationViewModel

- (void)resetDataSource {
    [self.dataSource resetRowListInSection:[self rows]];
}

- (NSArray <BaseAnimationTitleTVCellModel *>* )rows {
    
    BaseAnimationTitleTVCellModel * rotation = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"旋转动画(默认z轴)" subTitle:@"transform.rotation" formValue:@(0) toValue:@(-2*M_PI)];
    
    BaseAnimationTitleTVCellModel * rotationX = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"X轴旋转动画" subTitle:@"transform.rotation.x" formValue:@(0) toValue:@(2*M_PI)];
    
    BaseAnimationTitleTVCellModel * rotationY = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"Y轴旋转动画" subTitle:@"transform.rotation.y" formValue:@(0) toValue:@(2*M_PI)];
    
    BaseAnimationTitleTVCellModel * rotationZ = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"Z轴旋转动画" subTitle:@"transform.rotation.z" formValue:@(0) toValue:@(2*M_PI)];
    
    BaseAnimationTitleTVCellModel * scale = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"缩放动画" subTitle:@"transform.scale" formValue:@(1) toValue:@(0)];
    
    BaseAnimationTitleTVCellModel * scaleX = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"X轴缩放动画" subTitle:@"transform.scale.x" formValue:@(0) toValue:@(1)];
    
    BaseAnimationTitleTVCellModel * scaleY = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"Y轴缩放动画" subTitle:@"transform.scale.y" formValue:@(0) toValue:@(1)];
    
    BaseAnimationTitleTVCellModel * scaleZ = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"Z轴缩放动画" subTitle:@"transform.scale.z" formValue:@(1) toValue:@(0)];
    
    BaseAnimationTitleTVCellModel * translation = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"平移动画" subTitle:@"transform.translation" formValue:[NSValue valueWithCGPoint:CGPointMake(0, 0)] toValue:[NSValue valueWithCGPoint:CGPointMake(100, 400)]];
    
    BaseAnimationTitleTVCellModel * translationX = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"X轴平移动画" subTitle:@"transform.translation.x" formValue:@(0) toValue:@(100)];
    
    BaseAnimationTitleTVCellModel * translationY = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"Y轴平移动画" subTitle:@"transform.translation.y" formValue:@(0) toValue:@(100)];
    
    BaseAnimationTitleTVCellModel * position = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"中心点位移动画" subTitle:@"position" formValue:[NSValue valueWithCGPoint:CGPointMake(0, 0)] toValue:[NSValue valueWithCGPoint:CGPointMake(100, 400)]];
    
    BaseAnimationTitleTVCellModel * positionX = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"中心点位移动画" subTitle:@"position.x" formValue:@(0) toValue:@(100)];
    
    BaseAnimationTitleTVCellModel * positionY = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"中心点位移动画" subTitle:@"position.y" formValue:@(0) toValue:@(100)];
    
    BaseAnimationTitleTVCellModel * opacity = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"透明度动画" subTitle:@"opacity" formValue:@(1) toValue:@(0.5)];
    
    BaseAnimationTitleTVCellModel * backgroundColor = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"背景色动画" subTitle:@"backgroundColor" formValue:(id)[UIColor blueColor].CGColor toValue:(id)[UIColor greenColor].CGColor];
    
    BaseAnimationTitleTVCellModel * cornerRadius = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"圆角动画" subTitle:@"cornerRadius" formValue:@(0) toValue:@(50)];
    
    BaseAnimationTitleTVCellModel * borderWidth = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"边框动画" subTitle:@"borderWidth" formValue:@(0) toValue:@(10)];
    
    BaseAnimationTitleTVCellModel * shadowColor = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"阴影颜色动画" subTitle:@"shadowColor" formValue:(id)[UIColor redColor].CGColor toValue:(id)[UIColor greenColor].CGColor];
    
    BaseAnimationTitleTVCellModel * shadowOffset = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"阴影偏移量动画" subTitle:@"shadowOffset" formValue:[NSValue valueWithCGPoint:CGPointMake(0, -10)] toValue:[NSValue valueWithCGPoint:CGPointMake(0, 10)]];
    
    BaseAnimationTitleTVCellModel * shadowOpacity = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"阴影透明度动画" subTitle:@"shadowOpacity" formValue:@(1) toValue:@(0.3)];
    
    BaseAnimationTitleTVCellModel * shadowRadius = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"阴影圆角动画" subTitle:@"shadowRadius" formValue:@(5) toValue:@(15)];
    
    BaseAnimationTitleTVCellModel * doudong = [[BaseAnimationTitleTVCellModel alloc]initWithCellClass:@"BaseAnimationTitleTVCell" title:@"抖动动画" subTitle:@"transform.rotation.z" formValue:@(-M_PI_4) toValue:@(M_PI_4)];
    
    return @[rotation,rotationX,rotationY,rotationZ,
             scale,scaleX,scaleY,scaleZ,
             translation,translationX,translationY,
             position,positionX,positionY,
             opacity,backgroundColor,cornerRadius,
             borderWidth,shadowColor,shadowOffset,
             shadowOpacity,shadowRadius
             ,doudong];
}

- (void)didSelectedRowModelWithindexPath:(NSIndexPath *)indexPath {
    
}

@end
